cmake_minimum_required (VERSION 3.18.4)
project ("util-docker")
# 这里是将当前目录下的所有源文件存进变量 SRC
file(GLOB_RECURSE SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp  ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
# 判断程序的安装目录是否为空
if(NOT CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
# 设置 libssh 头文件路径，根据实际情况修改
set(LIBSSH_INCLUDE_DIR /usr/include/libssh)
# 设置 libssh 库文件路径，根据实际情况修改
set(LIBSSH_LIBRARY /usr/lib/x86_64-linux-gnu/libssh.so)





# 链接动态库目录
link_directories(/usr/local/lib64/debug)
# 存放程序目录
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_INSTALL_PREFIX}/bin)
# 存放程序昵称
set(APP_NAME "util-docker")
#  链接头文件
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# 包含头文件目录
include_directories(${LIBSSH_INCLUDE_DIR})
#
# 该可执行目标是由SRC_LIST中所列出的源文件生成
add_executable(${APP_NAME} ${SRC})
# 查找并链接libcurl库
#find_package(CURL REQUIRED)
#target_link_libraries(${APP_NAME} PRIVATE CURL::libcurl ${LIBSSH_LIBRARY})
# 设置安装规则/usr/local/lib64/debug/libmysqlcppconn8.so
install(TARGETS ${APP_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

